<<<<<<< HEAD
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Allen Demo</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="description" content="">
    <meta name="keywords" content="">

    <!-- Base Css Files -->
    <link href="/static/admin/assets/libs/jqueryui/ui-lightness/jquery-ui-1.10.4.custom.min.css" rel="stylesheet"/>
    <link href="/static/admin/assets/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="/static/admin/assets/libs/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="/static/admin/assets/libs/fontello/css/fontello.css" rel="stylesheet"/>
    <link href="/static/admin/assets/libs/animate-css/animate.min.css" rel="stylesheet"/>
    <link href="/static/admin/assets/libs/nifty-modal/css/component.css" rel="stylesheet"/>
    <link href="/static/admin/assets/libs/magnific-popup/magnific-popup.css" rel="stylesheet"/>
    <link href="/static/admin/assets/libs/ios7-switch/ios7-switch.css" rel="stylesheet"/>
    <link href="/static/admin/assets/libs/pace/pace.css" rel="stylesheet"/>
    <link href="/static/admin/assets/libs/sortable/sortable-theme-bootstrap.css" rel="stylesheet"/>
    <link href="/static/admin/assets/libs/bootstrap-datepicker/css/datepicker.css" rel="stylesheet"/>
    <link href="/static/admin/assets/libs/jquery-icheck/skins/all.css" rel="stylesheet"/>
    <!-- Code Highlighter for Demo -->
    <link href="/static/admin/assets/libs/prettify/github.css" rel="stylesheet"/>
    <link href="/static/index/css/toastr.min.css" rel="stylesheet"/>

    <!-- Extra CSS Libraries Start -->
    <link href="/static/admin/assets/libs/rickshaw/rickshaw.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/admin/assets/libs/morrischart/morris.css" rel="stylesheet" type="text/css"/>
    <link href="/static/admin/assets/libs/jquery-jvectormap/css/jquery-jvectormap-1.2.2.css" rel="stylesheet"
          type="text/css"/>
    <link href="/static/admin/assets/libs/jquery-clock/clock.css" rel="stylesheet" type="text/css"/>
    <link href="/static/admin/assets/libs/bootstrap-calendar/css/bic_calendar.css" rel="stylesheet" type="text/css"/>
    <link href="/static/admin/assets/libs/sortable/sortable-theme-bootstrap.css" rel="stylesheet" type="text/css"/>
    <link href="/static/admin/assets/libs/jquery-weather/simpleweather.css" rel="stylesheet" type="text/css"/>
    <link href="/static/admin/assets/libs/bootstrap-xeditable/css/bootstrap-editable.css" rel="stylesheet"
          type="text/css"/>
    <link href="/static/admin/assets/css/style.css" rel="stylesheet" type="text/css"/>
    <!-- Extra CSS Libraries End -->
    <link href="/static/admin/assets/css/style-responsive.css" rel="stylesheet"/>

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="/static/admin/assets/js/html5shiv.js"></script>
    <script src="/static/admin/assets/js/1.3.0/respond.min.js"></script>
    <![endif]-->

    <link rel="shortcut icon" href="/static/admin/assets/img/favicon.ico">
</head>
<body class="fixed-left">
<!-- Modal Start -->
<!-- Modal Task Progress -->
<div class="md-modal md-3d-flip-vertical" id="task-progress">
    <div class="md-content">
        <h3><strong>个人博客</strong></h3>
        <div>
            <p class="h2">Future Technology</p>
            <p class="text-center">
                <button class="btn btn-danger btn-lg md-close">Close</button>
            </p>
        </div>
    </div>
</div>

<!-- Modal Logout -->
<div class="md-modal md-just-me" id="logout-modal">
    <div class="md-content">
        <h3><strong>登出</strong> Logout</h3>
        <div>
            <p class="text-center">
                你确定要退出个人博客系统?
            </p>
            <p class="text-center">
                <button class="btn btn-primary md-close">NO . 我要返回</button>
                <a href="{:url('admin/Publics/logout')}" class="btn btn-danger md-close">Yeah . 我要退出</a>
            </p>
        </div>
    </div>
</div><!-- Modal End -->

<!-- Begin page -->
<div id="wrapper">

    <!-- Top Bar Start -->
    <div class="topbar">
        <div class="topbar-left">
            <div class="logo">
                <h1><img src="/static/admin/assets/img/logo.png" alt="Logo"></h1>
            </div>
            <button class="button-menu-mobile open-left">
                <i class="fa fa-bars"></i>
            </button>
        </div>
        <!-- Button mobile view to collapse sidebar menu -->
        <div class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-collapse2">
                    <ul class="nav navbar-nav navbar-right top-navbar">

                        <li class="dropdown topbar-profile">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span
                                    class="rounded-image topbar-profile-image"><img
                                    src="/static/index/face/batman.jpg"></span><strong>{$Think.session.userData.username}</strong> <i
                                    class="fa fa-caret-down"></i></a>
                            <ul class="dropdown-menu">
                                <li><a class="md-trigger" data-modal="logout-modal"><i class="icon-logout-1"></i>
                                    登出系统</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
                <!--/.nav-collapse -->
            </div>
        </div>
    </div>
    <div class="modal fade" tabindex="-1" role="dialog">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">Modal title</h4>
                </div>
                <div class="modal-body">
                    <p>One fine body&hellip;</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary">Save changes</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    <!-- Top Bar End -->
    <!-- Left Sidebar Start -->
    <div class="left side-menu">
        <div class="sidebar-inner slimscrollleft">
            <div class="clearfix"></div>
            <!--- Profile -->
            <div class="profile-info">
                <div class="col-xs-4">
                    <a data-toggle="tooltip" title="See task progress" class="md-trigger" data-modal="task-progress"><img
                            src="/static/index/face/batman.jpg" class="img-responsive rounded-image profile-image"></a>
                </div>
                <div class="col-xs-8">
                    <div class="profile-text">Welcome
                        <br>
                        {$Think.session.userData.username}</div>
                    <div class="profile-buttons">
                        <a class="md-trigger" data-modal="logout-modal" title="Sign Out"><i
                                class="fa fa-power-off text-red-1"></i></a>
                    </div>
                </div>
            </div>
            <!--- Divider -->
            <div class="clearfix"></div>
            <hr class="divider"/>
            <div class="clearfix"></div>
            <!--- Divider -->
            <div id="sidebar-menu">
                <ul>
                    <li class="has_sub"><a href="javascript:void(0);"><i class="glyphicon glyphicon-user"></i><span>用户管理</span>
                        <span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
                        <ul>
                            <li><a href="{:url('admin/user/index')}"><span>用户列表</span></a></li>
                            <li><a href="{:url('admin/user/add')}"><span>用户添加</span></a></li>
                        </ul>
                    </li>
                    <li class="has_sub"><a href="javascript:void(0);"><i class="glyphicon glyphicon-leaf"></i><span>角色管理</span>
                        <span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
                        <ul>
                            <li><a href="{:url('admin/role/index')}"><span>角色列表</span></a></li>
                            <li><a href="{:url('admin/role/add')}"><span>角色添加</span></a></li>
                        </ul>
                    </li>
                    <li class="has_sub"><a href="javascript:void(0);"><i class="glyphicon glyphicon-tags"></i><span>节点 管理</span>
                    <span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
                    <ul>
                        <li><a href="{:url('admin/node/index')}"><span>节点列表</span></a></li>
                        <li><a href="{:url('admin/node/add')}"><span>节点添加</span></a></li>
                    </ul>
                </li>
                    <li class="has_sub"><a href="javascript:void(0);"><i class="glyphicon glyphicon-list-alt
"></i><span>文章管理</span>
                        <span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
                        <ul>
                            <li><a href="{:url('admin/article/index')}"><span>文章列表</span></a></li>
                            <li><a href="{:url('admin/article/add')}"><span>文章添加</span></a></li>
                        </ul>
                    </li>
                    <li class="has_sub"><a href="javascript:void(0);"><i class="glyphicon glyphicon-globe"></i><span>广告管理</span>
                        <span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
                        <ul>
                            <li><a href="{:url('admin/poster/index')}"><span>广告列表</span></a></li>
                            <li><a href="{:url('admin/poster/add')}"><span>添加广告</span></a></li>
                        </ul>
                    </li>
                    <li class="has_sub"><a href="javascript:void(0);"><i class="glyphicon glyphicon-bookmark"></i><span>帖子管理</span>
                        <span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
                        <ul>
                            <li><a href="{:url('admin/post/index')}"><span>帖子列表</span></a></li>
                        </ul>
                    </li>
                    <li class="has_sub"><a href="javascript:void(0);"><i class="glyphicon glyphicon-bookmark"></i><span>评论管理</span>
                        <span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
                        <ul>
                            <li><a href="{:url('admin/comment/article')}"><span>文章评论</span></a></li>
                            <li><a href="{:url('admin/comment/post')}"><span>帖子评论</span></a></li>
                        </ul>
                    </li>
                    <li class="has_sub"><a href="javascript:void(0);"><i class="glyphicon glyphicon-bookmark"></i><span>栏目管理</span>
                        <span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
                        <ul>
                            <li><a href="{:url('admin/column/index')}"><span>栏目列表</span></a></li>
                            <li><a href="{:url('admin/column/create')}"><span>栏目添加</span></a></li>
                        </ul>
                    </li>
                    <li class="has_sub"><a href="javascript:void(0);"><i class="glyphicon glyphicon-bookmark"></i><span>友情链接管理</span>
                        <span class="pull-right"><i class="fa fa-angle-down"></i></span></a>
                        <ul>
                            <li><a href="{:url('admin/link/index')}"><span>友情链接列表</span></a></li>
                            <li><a href="{:url('admin/link/create')}"><span>友情链接添加</span></a></li>
                        </ul>
                    </li>
                </ul>
                <div class="clearfix"></div>
            </div>
            <div class="clearfix"></div>
            <br><br><br>
        </div>
    </div>
    <!-- Left Sidebar End -->
{block name="main"}
    <!-- Start right content -->
    <!--<div class="content-page">-->

        <!--<div class="content">-->

            <!--<div class="page-heading">-->
                <!--<h1><i class='fa fa-table'></i>后台用户管理</h1>-->
                <!--<h3>用户列表</h3>-->
            <!--</div>-->

            <!--<div class="row">-->

                <!--<div class="col-md-12">-->
                    <!--<div class="widget">-->
                        <!--<div class="widget-header transparent">-->
                            <!--&lt;!&ndash; Button trigger modal &ndash;&gt;-->
                            <!--<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">搜索-->
                            <!--</button>-->

                            <!--&lt;!&ndash; Modal &ndash;&gt;-->
                            <!--<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">-->
                                <!--<div class="modal-dialog" role="document">-->
                                    <!--<div class="modal-content">-->

                                        <!--<form action="{:url('admin/user/search')}" method="post">-->
                                            <!--<div class="modal-header">-->
                                                <!--<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>-->
                                                <!--<h4 class="modal-title" id="myModalLabel">搜索用户</h4>-->
                                            <!--</div>-->
                                            <!--<div class="modal-body">-->
                                                <!--<span style="color: black;">用户名:<input type="text" name="search" placeholder="search..."></span>-->
                                            <!--</div>-->
                                            <!--<div class="modal-footer">-->
                                                <!--<button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>-->
                                                <!--<button type="submit" class="btn btn-success">确定</button>-->
                                            <!--</div>-->
                                        <!--</form>-->
                                    <!--</div>-->
                                <!--</div>-->
                            <!--</div>-->
                        <!--</div>-->
                        <!--<div class="widget-content">-->
                            <!--<div class="table-responsive">-->
                                <!--<table data-sortable class="table">-->
                                    <!--<tr>-->
                                        <!--<th>ID</th>-->
                                        <!--<th>用户名</th>-->
                                        <!--<th>所属角色</th>-->
                                        <!--<th>操作</th>-->
                                        <!--{volist name="list" id="v"}-->
                                    <!--<tr>-->
                                        <!--<td>{$v.id}</td>-->
                                        <!--<td>{$v.username}</td>-->
                                        <!--<td>-->
                                            <!--{volist name="v.role" id="val"}-->
                                            <!--<span style="color:#999">{$val}</span>-->
                                            <!--&nbsp;-->
                                            <!--{/volist}-->
                                        <!--</td>-->
                                        <!--<td>-->
                                            <!--&lt;!&ndash;<a href="{:url('admin/user/edit',['id'=>$v['id']])}" class="btn btn-warning ">修改</a>&ndash;&gt;-->
                                            <!--<button class="btn btn-warning up-btn" data-id="{$v.id}" data-toggle="modal" data-target="#myModal-edit">修改-->
                                            <!--</button>-->

                                            <!--<button class="btn btn-danger delete-btn" data-id="{$v.id}">删除</button>-->
                                            <!--<a href="{:url('admin/user/rolelist',['id'=>$v['id']])}" class="btn btn-success" data-dismiss="modal">分配角色</a>-->
                                            <!--&lt;!&ndash;<button class="btn btn-success uprole-btn" data-id="{$v.id}" data-toggle="modal" data-target="#myModal-role">分配角色&ndash;&gt;-->
                                            <!--&lt;!&ndash;</button>&ndash;&gt;-->
                                        <!--</td>-->
                                    <!--</tr>-->
                                    <!--&lt;!&ndash; Modal 修改用户名&ndash;&gt;-->
                                    <!--<div class="modal fade" id="myModal-edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">-->
                                        <!--<div class="modal-dialog" role="document">-->
                                            <!--<div class="modal-content">-->
                                                <!--<div class="modal-header">-->
                                                    <!--<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>-->
                                                    <!--<h4 class="modal-title" id="myModalLabel">修改用户名</h4>-->
                                                <!--</div>-->
                                                <!--<form class="update-btn" method="post">-->
                                                    <!--<div class="modal-body">-->
                                                        <!--用户名:<input type="input" class="up-name" id="username" name="username"  value="">-->
                                                    <!--</div>-->
                                                    <!--<div class="modal-footer">-->
                                                        <!--<button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>-->
                                                        <!--<button type="button" data-id="{$v.id}" class="btn btn-success update-btn">确认</button>-->
                                                    <!--</div>-->
                                                <!--</form>-->
                                            <!--</div>-->
                                        <!--</div>-->
                                    <!--</div>-->
                                    <!--&lt;!&ndash; end Modal &ndash;&gt;-->
                                    <!--&lt;!&ndash; Modal 分配角色&ndash;&gt;-->
                                    <!--&lt;!&ndash;<div class="modal fade" id="myModal-role" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">&ndash;&gt;-->
                                    <!--&lt;!&ndash;<div class="modal-dialog" role="document">&ndash;&gt;-->
                                    <!--&lt;!&ndash;<div class="modal-content">&ndash;&gt;-->
                                    <!--&lt;!&ndash;<div class="modal-header">&ndash;&gt;-->
                                    <!--&lt;!&ndash;<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>&ndash;&gt;-->
                                    <!--&lt;!&ndash;<h4 class="modal-title" id="myModalLabel">分配角色</h4>&ndash;&gt;-->
                                    <!--&lt;!&ndash;</div>&ndash;&gt;-->
                                    <!--&lt;!&ndash;<form class="update-btn" method="post">&ndash;&gt;-->
                                    <!--&lt;!&ndash;<div class="modal-body">&ndash;&gt;-->
                                    <!--&lt;!&ndash;用户名:<input type="input" class="up-name" id="username" name="username"  value="">&ndash;&gt;-->
                                    <!--&lt;!&ndash;</div>&ndash;&gt;-->
                                    <!--&lt;!&ndash;<div class="modal-footer">&ndash;&gt;-->
                                    <!--&lt;!&ndash;<button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>&ndash;&gt;-->
                                    <!--&lt;!&ndash;<button type="button" data-id="{$v.id}" class="btn btn-success update-btn">确认</button>&ndash;&gt;-->
                                    <!--&lt;!&ndash;</div>&ndash;&gt;-->
                                    <!--&lt;!&ndash;</form>&ndash;&gt;-->
                                    <!--&lt;!&ndash;</div>&ndash;&gt;-->
                                    <!--&lt;!&ndash;</div>&ndash;&gt;-->
                                    <!--&lt;!&ndash;</div>&ndash;&gt;-->
                                    <!--&lt;!&ndash; end Modal &ndash;&gt;-->
                                    <!--{/volist}-->
                                    <!--</tr>-->
                                    <!--</thead>-->
                                    <!--<tbody>-->
                                    <!--</tbody>-->
                                <!--</table>-->
                            <!--</div>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</div>-->

            <!--<div class="page-heading">-->
                <!--<h1><i class='fa fa-table'></i>前台用户管理</h1>-->
                <!--<h3>用户列表</h3>-->
            <!--</div>-->
            <!--<div class="row">-->
                <!--<div class="col-md-12">-->
                    <!--<div class="widget">-->
                        <!--<div class="widget-content">-->
                            <!--<div class="table-responsive">-->
                                <!--<table data-sortable class="table">-->
                                    <!--<tr>-->
                                        <!--<th>ID</th>-->
                                        <!--<th>用户名</th>-->
                                        <!--<th>操作</th>-->
                                        <!--{volist name="lists" id="v"}-->
                                    <!--<tr>-->
                                        <!--<td>{$v.user_id}</td>-->
                                        <!--<td>{$v.username}</td>-->
                                        <!--<td>-->
                                            <!--<button class="btn btn-danger del-btn" data-id="{$v.user_id}">删除</button>-->
                                        <!--</td>-->
                                    <!--</tr>-->
                                    <!--{/volist}-->
                                    <!--</tr>-->
                                    <!--</thead>-->
                                    <!--<tbody>-->
                                    <!--</tbody>-->
                                <!--</table>-->
                                <!--{$lists->render()}-->
                            <!--</div>-->
                        <!--</div>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->
        <!--&lt;!&ndash; ============================================================== &ndash;&gt;-->
        <!--&lt;!&ndash; End content here &ndash;&gt;-->
        <!--&lt;!&ndash; ============================================================== &ndash;&gt;-->

    <!--</div>-->

    <!-- End right content -->
    <img style="width:100%;" src="/static/admin/images/timg.jpg">
{/block}

</div>

<!-- End of page -->
<!-- the overlay modal element -->
<div class="md-overlay"></div>
<!-- End of eoverlay modal -->
<script>
    var resizefunc = [];
</script>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="/static/admin/assets/libs/jquery/jquery-1.11.1.min.js"></script>
<script src="/static/admin/assets/libs/bootstrap/js/bootstrap.min.js"></script>
<script src="/static/admin/assets/libs/jqueryui/jquery-ui-1.10.4.custom.min.js"></script>
<script src="/static/admin/assets/libs/jquery-ui-touch/jquery.ui.touch-punch.min.js"></script>
<script src="/static/admin/assets/libs/jquery-detectmobile/detect.js"></script>
<script src="/static/admin/assets/libs/jquery-animate-numbers/jquery.animateNumbers.js"></script>
<script src="/static/admin/assets/libs/ios7-switch/ios7.switch.js"></script>
<script src="/static/admin/assets/libs/fastclick/fastclick.js"></script>
<script src="/static/admin/assets/libs/jquery-blockui/jquery.blockUI.js"></script>
<script src="/static/admin/assets/libs/bootstrap-bootbox/bootbox.min.js"></script>
<script src="/static/admin/assets/libs/jquery-slimscroll/jquery.slimscroll.js"></script>
<script src="/static/admin/assets/libs/jquery-sparkline/jquery-sparkline.js"></script>
<script src="/static/admin/assets/libs/nifty-modal/js/classie.js"></script>
<script src="/static/admin/assets/libs/nifty-modal/js/modalEffects.js"></script>
<script src="/static/admin/assets/libs/sortable/sortable.min.js"></script>
<script src="/static/admin/assets/libs/bootstrap-fileinput/bootstrap.file-input.js"></script>
<script src="/static/admin/assets/libs/bootstrap-select/bootstrap-select.min.js"></script>
<script src="/static/admin/assets/libs/bootstrap-select2/select2.min.js"></script>
<script src="/static/admin/assets/libs/magnific-popup/jquery.magnific-popup.min.js"></script>
<script src="/static/admin/assets/libs/pace/pace.min.js"></script>
<script src="/static/admin/assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script src="/static/admin/assets/libs/jquery-icheck/icheck.min.js"></script>
<script src="/static/index/js/toastr.min.js"></script>
<!-- Demo Specific JS Libraries -->
<script src="/static/admin/assets/libs/prettify/prettify.js"></script>

<script src="/static/admin/assets/js/init.js"></script>
<!-- Page Specific JS Libraries -->
<script src="/static/admin/assets/libs/d3/d3.v3.js"></script>
<script src="/static/admin/assets/libs/rickshaw/rickshaw.min.js"></script>
<script src="/static/admin/assets/libs/raphael/raphael-min.js"></script>
<script src="/static/admin/assets/libs/morrischart/morris.min.js"></script>
<script src="/static/admin/assets/libs/jquery-knob/jquery.knob.js"></script>
<script src="/static/admin/assets/libs/jquery-jvectormap/js/jquery-jvectormap-1.2.2.min.js"></script>
<script src="/static/admin/assets/libs/jquery-jvectormap/js/jquery-jvectormap-us-aea-en.js"></script>
<script src="/static/admin/assets/libs/jquery-clock/clock.js"></script>
<script src="/static/admin/assets/libs/jquery-easypiechart/jquery.easypiechart.min.js"></script>
<script src="/static/admin/assets/libs/jquery-weather/jquery.simpleWeather-2.6.min.js"></script>
<script src="/static/admin/assets/libs/bootstrap-xeditable/js/bootstrap-editable.min.js"></script>
<script src="/static/admin/assets/libs/bootstrap-calendar/js/bic_calendar.min.js"></script>
<script src="/static/admin/assets/js/apps/calculator.js"></script>
<script src="/static/admin/assets/js/apps/todo.js"></script>
<script src="/static/admin/assets/js/apps/notes.js"></script>
<script src="/static/admin/assets/js/pages/index.js"></script>

<script>
    //后台用户删除
    $(function () {
        // 触发删除用户
        $('.delete-btn').click(function () {
            var ac_id = $(this).attr('data-id');
            //                 console.log('删除操作,ID为: ' + ac_id);

            if (confirm('您确定要 [ 删 除 ] 该用户吗?')) {
                var obj = $(this).parents('tr');

                delAjax(ac_id, obj); // 执行AJAX删除

            }
        });
    });
    //删除用户
    function delAjax(id, obj) {
        $.ajax({
            type: 'delete',
            url: '/admin/user/delete/id/' + id + '.html',
            dataType : 'json',
            success : function (data){
                if (data.status) {
                    toastr.success(data.info);
                    obj.remove();
                } else {
                    toastr.error(data.info);
                }
            },
            error : function () {
                alert('AJAX执行失败!');
            }
        });
    }

    //前台用户删除
    $(function () {
        // 触发删除用户
        $('.del-btn').click(function () {
            var ac_id = $(this).attr('data-id');
            //                 console.log('删除操作,ID为: ' + ac_id);
            if (confirm('您确定要 [ 删 除 ] 该用户吗?')) {
                var obj = $(this).parents('tr');

                delAjax(ac_id, obj); // 执行AJAX删除

            }
        });
    });
    //删除用户
    function delAjax(id, obj) {
        $.ajax({
            type: 'delete',
            url: '/admin/user/del/id/' + id + '.html',
            dataType : 'json',
            success : function (data){
                if (data.status) {
                    toastr.success(data.info);
                    obj.remove();
                } else {
                    toastr.error(data.info);
                }
            },
            error : function () {
                alert('AJAX执行失败!');
            }
        });
    }

    //修改用户-传递值
    $(function () {
        $('.up-btn').click(function () {
            var ac_id = $(this).attr('data-id');
            //
            //             console.log('删除操作,ID为: ' + ac_id);
            upAjax(ac_id);
        });
    });
    //        /admin/user/edit/id/12.html
    //        /admin/user/update/id/12.html
    function upAjax(id){
        var info = 'id'+'='+id;
        //            alert(info);

        $.ajax({
            type : 'post',
            url : '/admin/user/edit/',
            data : info,
            dataType : 'json',
            success:function(data){
                $('.up-name').val(data.username);
                //                    if(data.status){
                //                        toastr.success(data.info);
                //                        console.log(data);die;
                //                    }
            },
            error : function () {
                alert('AJAX执行失败!');
            }
        });
    }
    //修改用户
    $(function () {
        $('.update-btn').click(function () {
            var ac_id = $(this).attr('data-id');
            //             console.log('删除操作,ID为: ' + ac_id);
            var list = $('.up-name').val();
            updateAjax(ac_id,list);
        });
    });

    function updateAjax(id,list){
        var info = 'id'+'='+id + '&' + 'list=' + list;

        $.ajax({
            type : 'post',
            url : '/admin/user/update/',
            data : info,
            dataType : 'json',
            success:function(data){
                if(data.status){
                    toastr.success(data.info);
                    setTimeout(function (){window.location.reload();},1000);

                }else{
                    toastr.error(data.info);
                }
            },
            error : function () {
                alert('AJAX执行失败!');
            }
        });
    }

    //        //分配角色
    //        $(function(){
    //            $('.uprole-btn').click(function (){
    //                var uid = $(this).attr('data-id');
    //                console.log(uid);
    //                uproleAjax(uid);
    //            });
    //        });
    //        function uproleAjax(id){
    //            var info = 'id'+'='+id;
    //            $.ajax({
    //                type : 'post',
    //                url : '/admin/user/rolelist/',
    //                data : info,
    //                dataType : 'json',
    //                success:function(data){
    //                    if(data.status){
    //                        toastr.success(data.info);
    //                        setTimeout(function (){window.location.reload();},1000);
    //
    //                    }else{
    //                        toastr.error(data.info);
    //                    }
    //                },
    //                error : function () {
    //                    alert('AJAX执行失败!');
    //                }
    //            });
    //        }
        toastr.options = {
        closeButton: true,// 是否显示关闭按钮
        progressBar: true,// 实现显示计时条
        timeOut: "1000",// 自动关闭时间
        positionClass: "toast-top-right"// 提示位置
        // positionClass: "toast-top-full-width"// 提示位置
        // toast-top-full-width 顶端，宽度铺满整个屏幕
        // toast-top-right  顶端右边
    };
</script>

</body>
</html>